#region Usings

using System.Xml.XPath;

#endregion

namespace Kazkommertsbank.Framework.Model.Pay
{
    public class Payment
    {
        private readonly string _xml;

        public Payment(XPathNavigator nav)
        {
            _xml = nav.OuterXml;
            MerchantId = nav.GetAttribute("merchant_id", "");
            Amount = nav.GetAttribute("amount", "");
            Reference = nav.GetAttribute("reference", "");
            ApprovalCode = nav.GetAttribute("approval_code", "");
            ResponseCode = nav.GetAttribute("response_code", "");
            Secure = nav.GetAttribute("Secure", "");
        }

        public string MerchantId { get; private set; }
        public string Amount { get; private set; }
        public string Reference { get; private set; }
        public string ApprovalCode { get; private set; }
        public string ResponseCode { get; private set; }
        public string Secure { get; private set; }

        public string ToXmlString()
        {
            return _xml;
        }
    }
}